<template>
  <el-card style="width: 100%">
    <div class="crumbs">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item v-for="(item, index) in pathName" :key="index">
          <router-link :to="item.path">{{ item.meta.title }}</router-link>
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <el-table :data="tableData" style="width: 80%">
      <el-table-column prop="files" label="文件名"></el-table-column>
      <el-table-column prop="date" label="下载时间"></el-table-column>
      <el-table-column prop="address" label="文件路径"></el-table-column>
      <el-table-column label="文件下载">
        <template>
          <el-button type="primary">下载</el-button>
        </template>
      </el-table-column>

      <template slot="empty">
        <myEmpty></myEmpty>
      </template>
    </el-table>
  </el-card>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          date: "2016-05-02",
          files: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-04",
          files: "李小龙",
          address: "上海市普陀区金沙江路 1517 弄"
        },
        {
          date: "2016-05-01",
          files: "马小跳",
          address: "上海市普陀区金沙江路 1519 弄"
        },
        {
          date: "2016-05-03",
          files: "大小王",
          address: "上海市普陀区金沙江路 1516 弄"
        }
      ],
      pathName: []
    };
  },
  methods: {
  },
  mounted() {
    this.navigationIndex = 'download'
    this.pathName = this.$route.matched
  },
  watch: {
    $route(to, from) {
      this.pathName = to.matched
    }
  }
};
</script>

<style lang="less" scoped>
.el-table {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
}

.crumbs {
  width: 100%;
  margin-bottom: 20px;
}
</style>